<include file="Public:header" />
<link href="__PUBLIC__/css/litebox.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/js/PCASClass.js" type="text/javascript"></script>
<!-- nice-scroll -->
<script src="__PUBLIC__/style/js/plugins/nice-scroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<script type="text/javascript" src="__PUBLIC__/style/js/TableFreeze.js"></script>
<script src="__PUBLIC__/js/mxcrm_more.js" type="text/javascript"></script>
<style>
    body{
        overflow-y: hidden;
    }
    .option{padding-left:-30px;}
    #oDivL_tab_Test3{background-color: #fff;}
    .table{max-width: none;}
    .status_ico {
        position: absolute;
        top: -48px;
        background: #FFF;
        border: 1px solid #AAA;
        border-radius: 5px;
        padding: 7px;
        width: 220px;
        display: inline-block;
        display: none;
        left: 50%;
        margin-left: -153px;
        z-index: 101;
    }
    .status_ico:before {
        content: "";
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #AAA;
        position: absolute;
        bottom: -10px;
        left: 100px;
    }
    .status_ico:after{
        content: "";
        width: 0;
        height: 0;
        border-left: 9px solid transparent;
        border-right: 9px solid transparent;
        border-top: 9px solid #FFF;
        position: absolute;
        bottom: -9px;
        left: 101px;
    }
    #right-sidebar-log{
        width: 60% !important;
        right: -60%;
        background-color: #fff;
        overflow: hidden;
        position: fixed;
        top: 60px;
        z-index: 1009;
        bottom: 0;
        box-shadow: -5px -5px 1px #ccc;
    }
    .sidebar-container ul.nav-tabs li a{
        background: #fff !important;
        color: #a7b1c2 !important;
        font-weight: 600 !important;
        padding: 14px 20px 14px !important;
        border-right: none !important;
    }
    .sidebar-container nav{
        display: none;
    }
    .sidebar-container #page-wrapper{
        margin-left: 0px;
    }
    #sidebar-container{
        box-shadow: rgb(187, 187, 187) -1px 10px 10px;
        border: 2px solid rgb(238, 238, 238);
    }
    .LocalDataUIB{
        border: 1px solid rgb(216, 227, 239) !important;
    }
    .LocalDataUIB-input{
        border: none;
    }
    .dropdown-menu{
        z-index: 99999 !important;
    }
    .ui-dialog .ui-dialog-content{
        overflow-x: hidden;
    }
</style>
<script>
    $(function () {
        $('#short_search').val() && $('.clearVal').css('display','inline-block');
        $('#short_search').on('input',ev=>{
            if(ev.target.value!=''){
                $('.clearVal').css('display','inline-block')
            }else{
                $('.clearVal').css('display','none')
            }
        })
        $('.clearVal').click(ev=>{
            $('#short_search').val('');
            $('.clearVal').css('display','none');
        })
        var scroll_width = 7;
        // var oTableLH_tab_Test3 = 38;
        $("#table_div").height(window.innerHeight - $("#table_div").offset().top - $("#tfoot_div").height() - parseInt($("#table_container").css("padding-bottom").replace("px", "")) - 10);
        $(window).resize(function () {
            $("#table_div").height(window.innerHeight - $("#table_div").offset().top - $("#tfoot_div").height() - parseInt($("#table_container").css("padding-bottom").replace("px", "")) - 10);
            $("#oDivL_tab_Test3").height($("#table_div").height() - scroll_width - 1).width($("#oTableLH_tab_Test3").width());
            $("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width() - scroll_width);
        })
        $(".nicescroll").niceScroll({
            cursorcolor: "#999", //#CC0071 光标颜色
            cursoropacitymax: 0.4, //改变不透明度非常光标处于活动状态（scrollabar“可见”状态），范围从1到0
            touchbehavior: false, //使光标拖动滚动像在台式电脑触摸设备
            cursorwidth: scroll_width + "px", //像素光标的宽度
            cursorborder: "0", //     游标边框css定义
            cursorborderradius: "3px", //以像素为光标边界半径
            autohidemode: false, //是否隐藏滚动条
            zindex: 100,
            background: "#F3F3F5", //滚动条背景色
        });
        if ("{$Think.get.by}") {
            $("#filter_ul").prev().html($("#filter_ul>li>a.active").text() + '<span class="fa fa-angle-down small_fa"></span>');
        }
        $("#tab_Test3").FrozenTable(1, 0, 3);
        $("#oDivL_tab_Test3").height($("#table_div").height() - scroll_width - 1).width($("#oTableLH_tab_Test3").width()).css({'zIndex': 9});
        $("#oDivL_tab_Test3").css({"background-color": "#fff", "border-right": "1px solid #e7eaec"});
        $("#oTableLH_tab_Test3").css({"border-right": "1px solid #e7eaec"});
        $("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width() - scroll_width).css({'zIndex': 9});
    })
</script>
<div class="wrapper wrapper-content">
    <input type="hidden" class="actions" value="<?php echo ACTION_NAME;?>"/>
    <include file="Public:alert" />
    <div class="row">
        <div class="col-md-12">
            <div class="ibox float-e-margins">
                <div class="title-bar" style="position: relative;z-index: 99;">
                    <div class="row clearfix" id="title-hide" style="display:none;">
                        <ul class="breadcrum pull-left">
                            <li>已选中&nbsp;<span id="icheck_num"></span>&nbsp;项</li>
                            <li class="single_btn"><a href="javascript:void(0)" id="log_business"><i class="fa fa-file-text"></i>&nbsp;添加沟通日志</a></li>
                            <li class="single_btn business_btn"><a href="javascript:void(0)" id="remind"><i class="fa fa-bell-o"></i>&nbsp;提醒</a></li>
                            <li class="single_btn"><a href="javascript:void(0)" id="edit_business"><i class="fa fa-pencil"></i>&nbsp;编辑</a></li>
                            <li class="single_btn business_btn"><a href="javascript:void(0)" id="to_top"><i class="fa fa-arrow-up"></i><span id="to_top_span">&nbsp;置顶</span></a></li>
                            <li class="single_btn business_btn"><a href="javascript:void(0)" id="to_allot"><i class="fa fa-american-sign-language-interpreting"></i><span id="">&nbsp;分配</span></a></li>
                            <li class="single_btn business_btn"><a href="javascript:void(0)" id="to_share"><i class="fa fa-bell-o"></i><span id="">&nbsp;共享项目</span></a></li>
                            <if condition = "$_GET['content'] neq 'resource'">
                                <li><a id="delete" href="javascript:void(0)"><i class="fa fa-times"></i>&nbsp;删除</a></li>
                            </if>
                            <li class="last_li"><big><a class="fa fa-times pull-right" id="back-show"></a></big></li>
                        </ul>
                    </div>
                    <div class="row " id="title-show">
                        <ul class="nav pull-left" style="margin:2px 0 0 15px;">
                            <a href="{:U('business/add')}" class="btn btn-primary btn-sm pull-left" style="margin-right:8px"><i class="fa fa-plus-circle"></i>&nbsp; 新建项目</a>
                        </ul>
                        <form class="form-inline" id="business_search" action="" method="get">
                            <ul class="breadcrum pull-right" style="margin-bottom: 0px">
                                <li>
                                    <div class="input-group" style="margin-right: 10px;margin-bottom: 5px;">
                                        <select class="form-control" onchange="window.open(this.options[this.selectedIndex].value, target = '_self')" >
                                            <option value="{:U('business/index','by=me&'.$by_parameter)}" <if condition = "$_GET['by'] eq 'me' || $_GET['by'] eq ''">selected="selected"</if>>我的项目</option>
                                            <option value="{:U('business/index','by=sub&'.$by_parameter)}" <if condition = "$_GET['by'] eq 'sub'">selected="selected"</if>>下属项目</option>
                                            <option value="{:U('business/index','by=all&'.$by_parameter)}" <if condition = "$_GET['by'] eq 'all'">selected="selected"</if>>全部项目</option>
                                        </select>
                                    </div>
                                </li>
                                <li>
                                    搜索：
                                    <div class="input-group" style='height:37px'>
                                        <span class="fa fa-times-circle clearVal" style="margin: 10px -10px;position: relative;z-index: 5;display:none;cursor:pointer;top:-8px;left:-4px"></span>
                                        <input type="hidden" name="m" value="business"/>
                                        <input type="hidden" name="a" value="index"/>
                                        <input type="hidden" name="field" value="name"/>
                                        <input type="hidden" name="condition" value="contains"/>
                                        <input type="hidden" name="by" value="{$_GET['by']}"/>
                                        <input id="short_search" type="text" style="width:200px;margin-top:-8px" placeholder="职位名/客户名/联系人/电话" onkeydown='if (event.keyCode == 13) {
                                                    $("#short_search_btn").trigger("click");
                                                    return false;
                                                }' class="form-control input-sm" name="search" <if condition = "$_GET['field'] eq 'name'">value="{$_GET['search']}"</if>/>
                                        <span class="input-group-btn">
                                            <button class="btn btn-default btn-search" id="short_search_btn" type="submit" style="height:32px;"><i class="fa fa-search"></i></button>
                                        </span>
                                        <select class="form-control" name="pro_type" id="pro_type" style="margin:0px 10px;width:150px;">
                                            <option value="">--请选择项目类型--</option>
                                            <option value="1">面试快</option>
                                            <option value="2">入职快</option>
                                            <option value="3">专业猎头</option>
                                            <option value="4">慧简历</option>
                                            <!--<option value="5">其他</option>-->
                                        </select>
                                        <select class="form-control" name="status_id" id="status_id" style="margin:0px 10px;width:150px;">
                                            <option value="">--请选择--</option>
                                            <volist name="businessStatusList" id="status">
                                                <option value="{$key|default=0}">{$status|default=''}</option>
                                            </volist>
                                        </select>
                                    </div>
                                    &nbsp;&nbsp;<!--<a title="高级搜索" href="javascript:void(0)" id="search_type" class="btn btn-white btn-bitbucket"><i class="fa fa-filter" style="color: #D8E3EF;"></i></a>-->
                                </li>
                            </ul>
                        </form>
                    </div>
                </div>
                <div class="ibox-content clearfix" id="table_container">
                    <form id="form1"  method="post" style="position:relative;" onkeydown='if (event.keyCode == 13) { $("#go_page").trigger("change"); return false; }' >
                        <div id="table_div" class="nicescroll">
                            <table class="table table-hover table-striped table_thead_fixed" id="tab_Test3">
                                <empty name="list">
                                    <div style="background-color:#fff;"><include file="Public:nodata" /></div>
                                    <else/>
                                    <tr id="childNodes_num" class="tabTh">
                                        <td style="width: 20px;padding-left: 20px">
                                            <div class="checkbox checkbox-primary">
                                                <input type="checkbox" class="check_all"/>
                                                <label for=" "></label>
                                            </div>
                                        </td>
                                        <td style="">&nbsp;</td>
                                        <td>项目名称</td>
                                    <volist name="field_array" id="vo">
                                        <if condition = "$vo['field'] eq 'contacts_id'" >
                                            <td>{$vo.name}</td>
                                            <td>联系电话</td>
                                            <elseif condition = "$vo['field'] eq 'status_id'" />
                                            <td colspan="3">{$vo.name}</td>
                                            <else />
                                            <td>{$vo.name}</td>
                                        </if>
                                    </volist>
                                    <td>推荐进度</td>
                                    <td>项目负责人</td>
                                    <td>项目成员</td>
                                    <td>
                                    <if condition="$_GET['desc_order'] == 'create_time'">
                                        <a href="{:U('business/index','asc_order=create_time&'.$parameter)}" title="点击按时间正序排列">
                                            {:L('CREATE_TIME')}&nbsp;<span class="fa fa-caret-down"></span>
                                        </a>
                                        <elseif condition="$_GET['asc_order'] == 'create_time'"/>
                                        <a href="{:U('business/index','desc_order=create_time&'.$parameter)}"  title="点击按时间倒序排列">
                                            {:L('CREATE_TIME')}&nbsp;<span class="fa fa-caret-up"></span>
                                        </a>
                                        <else/>
                                        <a href="{:U('business/index','asc_order=create_time&'.$parameter)}" title="点击按时间正序排列">{:L('CREATE_TIME')}&nbsp;<span class="fa fa-caret-down"></a>
                                    </if>
                                    </td>
                                    </tr>
                                    <volist name="list" id="vo">
                                        <tr class="controls_tr">
                                            <td style="padding-left: 20px">
                                                <div class="checkbox checkbox-primary">
                                                    <input name="business_id[]" class="check_list" type="checkbox" value="{$vo.business_id}" rel="{$vo['business_id']}" rel1="{$vo['set_top']}" rel2="{$vo['remind_time']}" />
                                                    <label for=""></label>
                                                </div>
                                            </td>
                                            <td>
                                                <a href="javascript:void(0);" class="remind_view" rel="{$vo['business_id']}">
                                                    <span class="fa fa-bell-o {$vo['remind_time'] > time() ? '':'hide'}" id="remind_view_{$vo['business_id']}" style="font-size:16px;color:orange"></span>
                                                </a>
                                            </td>
                                            <td>
                                        <if condition="$vo['set_top'] eq 1">
                                            <a style="border-left: 5px solid #ffb07b;padding-left: 5px;" class="" href="{:U('business/view','id='.$vo['business_id'])}" rel="{$vo['business_id']}">{$vo['name']}</a>
                                            <else />
                                            <a style="padding-left: 5px;" class="" href="{:U('business/view','id='.$vo['business_id'])}" rel="{$vo['business_id']}">{$vo['name']}</a>
                                        </if>
                                        </td>
                                        <volist name="field_array" id="v">
                                            <if condition = "$v['field'] eq 'customer_id'">
                                                <td>
                                                    <a href="{:U('customer/view','id='.$vo['customer_id'])}">{$vo['customer_name']}</a>
                                                </td>
                                                <elseif condition = "$v['field'] eq 'contacts_id'" />
                                                <td>
                                                <notempty name="vo.contacts_id">
                                                    <a href="{:U('contacts/view','id='.$vo['contacts_id'])}">{$vo['contacts_name']}</a>
                                                </notempty>
                                                </td>
                                                <td>{$vo['c_telephone']}</td>
                                                <elseif condition = "$v['field'] eq 'status_id'" />
                                                <td class="detail-right " style="max-width: 20px;">
                                                    <a href="javascript:void(0);" data-toggle="tooltip" data-placement="bottom" data-original-title="{$vo['product_name']}" rel="{$vo['business_id']}" rel1 = "{$vo['customer_id']}" rel2="{$vo['code']}" class="product_view tooltip-show"><i class="fa fa-circle fa-1x"></i></a>
                                                </td>
                                                <td style="">
                                                    <div class="progress progress-mini m-b-sm" style="cursor:pointer;background-color: #DDD;" data-toggle="tooltip" data-placement="top" class="" data-original-title="{$vo['status_info']['name']}" >
                                                        <div class="progress-bar <?php if($vo['status_info']['is_end']==2){echo 'progress-bar-danger';}else{if($vo['progress']<=30){echo 'progress-bar-danger';}elseif($vo['progress']<=60){echo 'progress-bar-warning';}elseif($vo['progress']<99){echo '';}else{echo 'progress-bar-success';}} ?>" style="width: {$vo['progress']}%;"></div>
                                                    </div>
                                                </td>
                                                <td class="detail-right" style="min-width: 30px;">
                                                <if condition = "$vo['status_info']['is_end'] eq 2">
                                                    <i class="fa fa-times-circle" style="color: #ED5565;"></i>
                                                    <else />
                                                    <a href="javascript:void(0);" data-toggle="tooltip" data-placement="right"  data-original-title="推进进度" rel="{$vo['business_id']}" rel1 = "{$vo['customer_id']}" rel2="{$vo['code']}" class="advance">
                                                        <i class="fa fa-forward"></i>
                                                    </a>
                                                </if>
                                                </td>
                                                <elseif  condition = "$v['field'] eq 'grade'" />
                                                <td>
                                                    <p class="form-p1">
                                                        <!-- 星星 -->
                                                        <?php $start = $vo['grade']+1; $end = 6-$vo['grade']; ?>
                                                        <span style="cursor:pointer;color:#D0D0D0;">
                                                            <for start="1" end="$start">
                                                                <i class="fa fa-star star-orange"></i>&nbsp;
                                                            </for><for start="1" end="$end">
                                                                <i class="fa fa-star"></i>&nbsp;
                                                            </for>
                                                        </span>
                                                    </p>
                                                </td>
                                                <else />
                                                <td>
                                                    <span style="color:#{$v['color']}">
                                                        <if condition="$v['form_type'] eq 'datetime'">
                                                            <if condition="$vo[$v['field']]">
                                                                {$vo[$v['field']]|date='Y-m-d H:i',###}
                                                            </if>
                                                            <else />
                                                            <if  condition="$v['field'] eq 'pro_type'">
                                                                <if condition="$vo['pro_type'] eq '1'">
                                                                    <span class="label">{$pro_type[$vo['pro_type']]}</span>
                                                                    <elseif condition="$vo['pro_type'] eq '2'"/>
                                                                    <span class="label">{$pro_type[$vo['pro_type']]}</span>
                                                                    <elseif condition="$vo['pro_type'] eq '3'"/>
                                                                    <span class="label">{$pro_type[$vo['pro_type']]}</span>
                                                                    <elseif condition="$vo['pro_type'] eq '4'"/>
                                                                    <span class="label">{$pro_type[$vo['pro_type']]}</span>
                                                                    <elseif condition="$vo['pro_type'] eq '5'"/>
                                                                    <span class="label">其他</span>
                                                                </if>
                                                                <else />{$vo[$v['field']]}</if>
                                                        </if>
                                                    </span>
                                                </td>
                                            </if>
                                        </volist>
                                        <td class="project-completion" style="position: relative;">
                                        <if condition="$vo['status_id'] eq '99'">
                                            <span class="label label-success jinzhan_status cur">{$businessStatusList[$vo['status_id']]|default=''}</span>
                                            <elseif condition="$vo['status_id'] eq '1'"/>
                                            <span class="label label-warning  jinzhan_status cur">{$businessStatusList[$vo['status_id']]|default=''}</span>
                                            <elseif condition="$vo['status_id'] eq '2'"/>
                                            <span class="label label-danger jinzhan_status cur">{$businessStatusList[$vo['status_id']]|default=''}</span>
                                            <elseif condition="$vo['status_id'] eq '98'"/>
                                            <span class="label label-black jinzhan_status cur">{$businessStatusList[$vo['status_id']]|default=''}</span>
                                            <elseif condition="$vo['status_id'] eq '3'"/>
                                            <span class="label label-primary jinzhan_status cur">{$businessStatusList[$vo['status_id']]|default=''}</span>
                                            <elseif condition="$vo['status_id'] eq '100'"/>
                                            <span class="label label-primary jinzhan_status cur">{$businessStatusList[$vo['status_id']]|default=''}</span>
                                            <else/>
                                            <span class="label label-warning jinzhan_status cur">状态不存在</span>
                                        </if>
                                        <div class="status_ico form-inline editable-wrap editable-select" role="form" blur="cancel">
                                            <div class="editable-controls form-group">
                                                <select class="form-control" style="vertical-align: baseline;height: 34px;">
                                                    <foreach  name="businessStatusList" item="businessStatus" key="key">
                                                        <option value="{$key|default='0'}" label="{$businessStatus|default=''}">{$businessStatus|default=''}</option>
                                                    </foreach >
                                                </select>
                                                <span class="editable-buttons">
                                                    <button type="button" class="btn btn-primary jinzhan_btnedit">
                                                        <span class="glyphicon glyphicon-ok"></span>
                                                    </button>
                                                    <button type="button" class="btn btn-default closeico">
                                                        <span class="glyphicon glyphicon-remove"></span>
                                                    </button>
                                                </span>
                                            </div>
                                        </div>
                                        </td>
                                        <td>
                                        <volist name="vo.owner" id="item">
                                            <notempty name="item.full_name"><a class="role_info" rel="{$item.role_id}" href="javascript:void(0)">{$item.full_name}</a></notempty>&nbsp;
                                        </volist>
                                        </td>
                                        <td>{$vo.parter_name}</td>
                                        <td>{$vo['create_time']|date='Y-m-d H:i:s',###}</td>
                                        </tr>
                                    </volist>
                                </empty>
                            </table>
                        </div>
                        <div id="tfoot_div" class="clearfix">
                            <div class="clearfix" id="tfoot_page">
                                <if condition="$fields_search || $_GET['field']">
                                    <span class="pull-left" style="margin-left:25px;margin-top:10px;">本次搜索结果<span style="color:#F8AC59"> {$count} </span>条数据<a href="{:U('business/index')}" class="btn" style="background:#fff;border:1px solid #ccc;margin-left:10px;color:#999;" id="clearnumber">清除搜索条件</a></span>
                                </if>
                                {$page}<include file="Public:listrows" />
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div style="display:none" id="dialog-log" title="{:L('ADD_THE_LOG')}">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div style="display:none" id="dialog-role-info" title="{:L('EMPLOYEE_INFORMATION')}">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div style="display:none;padding: 0" id="dialog-role-owner" title="选择项目负责人">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div style="display:none" id="dialog-advance" title="阶段变更">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div style="display:none" id="dialog-remind" title="提醒">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div style="display:none" id="dialog-remind_view" title="提醒内容">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div style="display:none" id="dialog-product_view" title="产品详情">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div style="display:none" id="dialog-field-search" title="高级搜索">
    <form class="form-inline" id="searchForm" action="" method="get">
        <div id="search_add" style="width:650px;float:left;">
            <input type="hidden" name="scene_id" value="{$_GET['scene_id']}"/>
            <if condition="$_GET['field'] eq ''">
                <input type="hidden" name="content" <if condition="$_GET['content']">value="resource"</if> />
                <input type="hidden" name="this_page" value="{$this_page}" />
                <input type="hidden" name="m" value="business"/>
                <input type="hidden" name="act" id="act" value="index"/>
                <input type="hidden" name="daochu" id="daochu"/>
                <input type="hidden" name="selectexcelxport" id="selectexcelxport"/>
                <input type="hidden" name="current_page" id="current_page" value=""/>
                <input type="hidden" name="export_limit" id="export_limit" value=""/>
                <if condition="$Think.get.by neq null">
                    <input type="hidden" name="by" value="{$Think.get.by}"/>
                </if>
            </if>
            <empty name="fields_search">
                <div id="con_search_1" style="float:left;width:650px;margin:0 10px 0 10px;">
                    <ul class="nav pull-left" style="margin:0px 0 0 23px;width:650px;">
                        <li class="pull-left">
                            <select id="field_1" style="width:auto" class="form-control input-sm field_name new-select" onchange="changeCondition(1)" >
                                <option class="" value="name">--{:L('PLEASE_SELECT_A_FILTER_CONDITION')}--</option>
                                <volist name="field_list" id="v">
                                    <if condition="$v['field'] neq 'customer_owner_id'">
                                        <option class="{$v['form_type']}" value="{$v[field]}" rel="customer" <if condition = "$_GET['field'] eq '' && $v['field'] eq 'name'">selected="selected"</if>>{$v[name]}</option>
                                    </if>
                                </volist>
                                <if condition="$Think.get.content neq 'resource'">
                                    <option class="role" value="owner_role_id">{:L('PRINCIPAL')}</option>
                                </if>
                                <option class="date" value="create_time">{:L('CREATION_TIME')}</option>
                                <option class="date" value="update_time">{:L('MODIFICATION_TIME')}</option>
                                <option class="text" value="contacts_name">首要联系人姓名</option>
                                <!--<option class="text" value="pro_type">项目类型</option>-->
                                <!--<option class="text" value="pro_status">项目进度</option>-->
                                <!--<option class="text" value="company">所属公司</option>-->
                            </select>&nbsp;&nbsp;
                        </li>
                        <li class="pull-left" id="conditionContent_1">
                            <select id="condition_1" style="width:auto" class="form-control input-sm new-select" onchange="changeSearch()" name="name[condition]">
                                <option value="contains">{:L('INCLUDE')}</option>
                                <option value="not_contain">{:L('EXCLUSIVE')}</option>
                                <option value="is">{:L('YES')}</option>
                                <option value="isnot">{:L('ISNOT')}</option>
                                <option value="start_with">{:L('BEGINNING_CHARACTER')}</option>
                                <option value="end_with">{:L('TERMINATION_CHARACTER')}</option>
                                <option value="is_empty">{:L('MANDATORY')}</option>
                                <option value="is_not_empty">{:L('ISNOTEMPTY')}</option>
                            </select>&nbsp;&nbsp;
                        </li>
                        <li class="pull-left" id="searchContent_1">
                            <input id="search_1" type="text" style="width:160px;" class="input-medium form-control input-sm search-query" name="name[value]"/>&nbsp;&nbsp;
                        </li>
                    </ul>
                </div>
                <?php $max_key = 1;?>
                <else />
                <volist name="fields_search" key="key1" id="vo">
                    <div id="con_search_{$key1}" style="float:left;width:650px;margin:10px 10px 0 10px;">
                        <div  id="rem_{$key1}" class="pull-left" style="line-height:30px;"><a href="javascript:void(0);" class="rem_search" rel="{$key1}" title="移除"><span class="fa fa-times-circle"></span></a></div>&nbsp;
                        <ul class="nav pull-left" style="margin:0px 0 0 5px;width:620px;">
                            <li class="pull-left">
                                <select id="field_{$key1}" style="width:160px" class="form-control input-sm field_name" onchange="changeCondition({$key1})" >
                                    <option class="" value="name">--{:L('PLEASE_SELECT_A_FILTER_CONDITION')}--</option>
                                    <volist name="field_list" id="v">
                                        <if condition="$v['field'] neq 'customer_owner_id'">
                                            <option class="{$v['form_type']}" value="{$v[field]}" rel="customer" <if condition = "$_GET['field'] eq '' && $v['field'] eq 'name'">selected="selected"</if>>{$v[name]}</option>
                                        </if>
                                    </volist>
                                    <if condition="$_GET['content'] neq 'resource'">
                                        <option class="role" value="owner_role_id" <if condition = "$vo['field'] eq 'owner_role_id'">selected="selected"</if>>{:L('PRINCIPAL')}</option>
                                    </if>
                                    <option class="date" value="create_time" <if condition = "$vo['field'] eq 'create_time'">selected="selected"</if>>{:L('CREATION_TIME')}</option>
                                    <option class="date" value="update_time" <if condition = "$vo['field'] eq 'update_time'">selected="selected"</if>>{:L('MODIFICATION_TIME')}</option>
                                    <option class="text" value="contacts_name" <if condition = "$vo['field'] eq 'contacts_name'">selected="selected"</if>>首要联系人姓名</option>
                                    <option class="mobile" value="contacts_telephone" <if condition = "$vo['field'] eq 'contacts_telephone'">selected="selected"</if>>首要联系人电话</option>
                                    <option class="text" value="pro_type" <if condition = "$vo['field'] eq 'pro_type'">selected="selected"</if>>项目类型</option>
                                    <option class="text" value="pro_status" <if condition = "$vo['field'] eq 'pro_status'">selected="selected"</if>>项目进度</option>
                                    <option class="text" value="company" <if condition = "$vo['field'] eq 'company'">selected="selected"</if>>所属公司</option>
                                </select>&nbsp;&nbsp;
                            </li>
                            <li class="pull-left" id="conditionContent_{$key1}">
                            <if condition="$vo.form_type eq 'number'">
                                <select style="width:100px;" class="form-control input-sm" name="{$vo['field']}[condition]">
                                    <option value="gt" <if condition="$fields_search[$vo['field']][condition] eq 'gt'">selected="selected"</if>>{:L('GT')}</option>
                                    <option value="lt" <if condition="$fields_search[$vo['field']][condition] eq 'lt'">selected="selected"</if>>{:L('LT')}</option>
                                    <option value="eq" <if condition="$fields_search[$vo['field']][condition] eq 'eq'">selected="selected"</if>>{:L('EQ')}</option>
                                    <option value="neq" <if condition="$fields_search[$vo['field']][condition] eq 'neq'">selected="selected"</if>>{:L('NEQ')}</option>
                                </select>
                                <elseif condition="$vo.field eq 'owner_role_id' || $vo.field eq 'status_id' || $vo.form_type eq 'datetime'"/>
                                <elseif condition="$vo.form_type eq 'box'" />
                                <span id="{$vo['field']}">{$vo.value}</span>
                                <script type="text/javascript">
                                    var b = '{$vo[field]}';
                                    var c = 'business';
                                    var value_str = $("#{$vo['field']}").html();
                                    $.ajax({
                                        type: 'get',
                                        url: 'index.php?m=setting&a=boxfield&model=' + c + '&field=' + b,
                                        async: false,
                                        success: function (data) {
                                            options = '';
                                            $.each(data.data, function (k, v) {
                                                if (value_str == v) {
                                                    select = 'selected';
                                                } else {
                                                    select = '';
                                                }
                                                options += "<option value='" + v + "' " + select + ">" + v + "</option>";
                                            });
                                            $("#{$vo['field']}").html('<select class="{$vo["field"]} form-control input-sm" style="width:auto" name="{$vo["field"]}[value]" ><option value="">--请选择--</option>' + options + '</select>&nbsp;&nbsp;');
                                        },
                                        dataType: 'json'
                                    });
                                    // <if condition="!empty($_GET[$vo['field']])">
                                    // 	$(".{$vo['field']} option[value='{$_GET[$vo['field']]}']").attr('selected','selected');
                                    // </if>
                                </script>
                                <elseif condition="$vo.form_type eq 'address'" />
                                <select style="width:auto;margin-top: 13px;" class="form-control input-sm" name="{$vo['field']}[condition]">
                                    <option value="contains" <if condition="$fields_search[$vo['field']][condition] eq 'contains'">selected="selected"</if>>{:L('IN')}</option>
                                    <option value="not_contain" <if condition="$fields_search[$vo['field']][condition] eq 'not_contain'">selected="selected"</if>>{:L('NOTIN')}</option>
                                </select>
                                <select name="{$vo['field']}[state]" class="form-control input-sm" id="state" style="width:135px;margin-top: 13px;"></select>
                                <!--<select name="{$vo['field']}[city]" class="form-control input-sm" id="city" style="width:110px;margin-top: 13px;"></select>-->
                                <!--<select name="{$vo['field']}[area]" class="form-control input-sm" id="area" style="width:110px;margin-top: 13px;"></select>-->
                                <input type="text" id="search" name="{$vo['field']}[value]" value="{$fields_search[$vo['field']][value]}" class="form-control input-sm" style="margin-top: 13px;" placeholder="{:L('THE_STREET_INFORMATION')}" class="input-large">
                                <script type="text/javascript">
                                    new PCAS("{$vo['field']}[state]", "{$vo['field']}[city]", "{$vo['field']}[area]", "<php>echo $fields_search[$vo['field']]['state'];</php>", "<php>echo $fields_search[$vo['field']]['city'];</php>", "<php>echo $fields_search[$vo['field']]['area'];</php>");
                                </script>
                                <else />
                                <select style="width:auto" class="form-control input-sm" name="{$vo['field']}[condition]">
                                    <option value="contains" <if condition="$fields_search[$vo['field']][condition] eq 'contains'">selected="selected"</if>>{:L('INCLUDE')}</option>
                                    <option value="not_contain" <if condition="$fields_search[$vo['field']][condition] eq 'not_contain'">selected="selected"</if>>{:L('EXCLUSIVE')}</option>
                                    <option value="is" <if condition="$fields_search[$vo['field']][condition] eq 'is'">selected="selected"</if>>{:L('YES')}</option>
                                    <option value="isnot" <if condition="$fields_search[$vo['field']][condition] eq 'isnot'">selected="selected"</if>>{:L('NO')}</option>
                                    <option value="start_with" <if condition="$fields_search[$vo['field']][condition] eq 'start_with'">selected="selected"</if>>{:L('BEGINNING_CHARACTER')}</option>
                                    <option value="end_with" <if condition="$fields_search[$vo['field']][condition] eq 'end_with'">selected="selected"</if>>{:L('TERMINATION_CHARACTER')}</option>
                                    <option value="is_empty" <if condition="$fields_search[$vo['field']][condition] eq 'is_empty'">selected="selected"</if>>{:L('MANDATORY')}</option>
                                    <option value="is_not_empty" <if condition="$fields_search[$vo['field']][condition] eq 'is_not_empty'">selected="selected"</if>>{:L('ISNOTEMPTY')}</option>
                                </select>
                            </if>
                            </li>
                            <li class="pull-left" id="searchContent_{$key1}" style="margin-left:5px;">
                            <if condition="$vo['form_type'] neq 'box' && $vo['form_type'] neq 'address'">
                                <if condition="$vo['form_type'] eq 'datetime'">
                                    <input id="start_{$vo['field']}" type="text" class="form-control input-sm search-query" name="{$vo['field']}[start]" onclick="WdatePicker()" value="{$fields_search[$vo['field']][start]}" rel="customer"/> 至 <input id="end_{$vo['field']}" type="text" class="form-control input-sm search-query" name="{$vo['field']}[end]" onclick="WdatePicker()" value="{$fields_search[$vo['field']][end]}" rel="customer"/>
                                    <elseif condition="$vo['field'] eq 'owner_role_id'"/>
                                    <span id="owner_role_search" rel="{$key1}" rel1="{$vo['field']}[value]" rel2="{$fields_search[$vo['field']][value]}"/>
                                    <script type="text/javascript">
                                        var key_id = $('#owner_role_search').attr('rel');
                                        var search_owner_role_id = $('#owner_role_search').attr('rel1');
                                        var owner_roleid = $('#owner_role_search').attr('rel2');
                                        $.ajax({
                                            type: 'get',
                                            url: 'index.php?m=user&a=getrolelist&module=business&action=index',
                                            async: false,
                                            success: function (data) {
                                                options = '';
                                                $.each(data.data, function (k, v) {
                                                    options += '<option value="' + v.role_id + '" checkedit>' + v.user_name + ' [' + v.department_name + '-' + v.role_name + '] </option>';
                                                });
                                                $("#searchContent_" + key_id + "").html('<select class="selectpicker show-tick form-control input-sm" data-live-search="true" id="search_' + key_id + '" name="' + search_owner_role_id + '" style="width:auto">' + options + '</select>');
                                                var owner_roleid = "{$fields_search[$vo['field']][value]}";
                                                $('#search_' + key_id + ' option[value=' + owner_roleid + ']').prop('selected', true);

                                            },
                                            dataType: 'json'
                                        });
                                    </script>
                                    <elseif condition="$vo['field'] eq 'status_id'"/>
                                    <span id="bus_status_id" rel="{$key1}" rel1="{$vo['field']}[value]" rel2="{$fields_search[$vo['field']][value]}"/>
                                    <script type="text/javascript">
                                        var key_id = $('#bus_status_id').attr('rel');
                                        var search = $('#bus_status_id').attr('rel1');
                                        var search_roleid = $('#bus_status_id').attr('rel2');
                                        $.ajax({
                                            type: 'get',
                                            url: 'index.php?m=setting&a=getbusinessstatuslist',
                                            async: false,
                                            success: function (data) {
                                                options = '';
                                                $.each(data.data, function (k, v) {
                                                    select = '';
                                                    if (v.status_id == search_roleid) {
                                                        select = 'selected';
                                                    }
                                                    options += '<option value="' + v.status_id + '" ' + select + '>' + v.name + '</option>';
                                                });

                                                $("#searchContent_" + key_id + "").html('<select class="form-control input-sm" id="search_' + key_id + '" style="width:auto" name="' + search + '">' + options + '</select>');
                                                var owner_roleid = "{$fields_search[$vo['field']][value]}";
                                                $('#search_' + key_id + ' option[value=' + owner_roleid + ']').prop('selected', true);
                                            },
                                            dataType: 'json'
                                        });
                                    </script>
                                    <else/>
                                    <input name="{$vo['field']}[value]" type="text" class="form-control input-sm search-query" class="{$vo['form_type']}" value="{$fields_search[$vo['field']][value]}" rel="customer">
                                </if>
                            </if>
                            </li>
                        </ul>
                    </div>
                    <?php $max_key = $key1;?>
                </volist>

            </empty>
        </div>
        <div class="clearfix"></div>
        <div style="margin-left: 35px;margin-top:10px;"><a href="javascript:void(0);" style="display: -moz-stack;margin: 30px 0px 0px; font-size: 12px; color: rgb(62, 133, 233);" id="add_btn">+添加筛选条件</a>
        </div>
        <div class="" style="margin-left: 20px;margin-top: 10px;">
            <div  class="form-group">
                <div class="col-md-3 control-label">所属行业：</div>
                <div class="col-md-7">
                    <input data-selector="industrys" class="text" type="text" placeholder="请选择行业" id="industrys" name="industry" data-ui="LocalDataUID" style="display: none;width:325px;height:40px;" rell="行业"/>
                </div>
            </div>
            <div  class="form-group" style="margin-top: 10px;">
                <div class="col-md-3 control-label">所属城市：</div>
                <div class="col-md-7">
                    <input data-selector="dqs" data-option="1" class="text" type="text" placeholder="选择所属城市" id="dqs" name="address" data-ui="LocalDataUIB" style="display: none;width:440px;height:40px;border: 1px solid #d8e3ef;" >
                </div>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">


    //鼠标点击空白处，隐藏右侧滑出
    document.onmousedown = function (event) {
        if (event.target.className == 'right-sidebar-toggle-log')
            return;
        var div = document.getElementById("right-sidebar-log");
        var x = event.clientX;
        var y = event.clientY;
        var divx1 = div.offsetLeft;
        var divy1 = div.offsetTop;
        var divx2 = div.offsetLeft + div.offsetWidth;
        var divy2 = div.offsetTop + div.offsetHeight;
        if (x < divx1 || x > divx2 || y < divy1 || y > divy2) {
            if ($("#right-sidebar-log").css('right') == '0px') {
                $("#right-sidebar-log").animate({right: '-60%'}, 400);
            }
        }
    }

    //日志详情弹出
    var timer;
    $(document).on('mouseenter', '.right-sidebar-toggle-log', function () {
        var log_id = $(this).attr('rel');
        clearTimeout(timer);
        timer = setTimeout(function () {

            if ($("#right-sidebar-log").css('right') != '0px') {
                $("#right-sidebar-log").animate({right: '0px'}, 600);
            }
            $('#sidebar-container').load("/index.php?m=business&a=view&id=" + log_id);
        }, 1000);
    });

    $(".right-sidebar-toggle-log").on("mouseleave", function () {
        clearTimeout(timer);
    })
</script>

<script type="text/javascript">
    /*让复选框默认取消选择*/
    $(':checkbox').prop('checked', false);

    $('[data-toggle="tooltip"]').tooltip({html: true});

//职位状态
    $('#status_id').val("{$Think.get.status_id}");
    $('#status_id').change(function () {
        $('#business_search').submit();
    });
    $('#pro_type').val("{$Think.get.pro_type}");
    $('#pro_type').change(function () {
        $('#business_search').submit();
    });


//状态分组
    var status_type_id = {$_GET['status_type_id'] | default = 1};
    $('#status_type_id').val(status_type_id);
    $('#status_type_id').change(function () {
        var type_id = $(this).val();
        var temp = '<option value="">--请选择--</option>';
        if (type_id) {
            $.ajax({
                'type': 'get',
                'data': {'type_id': type_id},
                'dataType': 'json',
                'url': '{:U("business/getbusinessStatus")}',
                'success': function (data) {
                    if (data.status == 1) {
                        $('#status_id').html('');
                        $.each(data.data, function (k, v) {
                            temp += '<option value="' + v.status_id + '">' + v.name + '</option>';
                        });
                        $('#status_id').html(temp);
                    } else {
                        alert_crm(data.info)
                    }
                }
            });
        }
        $('#business_search').submit();
    });

    $('#example').mouseenter(function () {
        $('.tooltip').css('opacity', '1');
    })
    $('#example').mouseleave(function () {
        $('.tooltip').css('opacity', '0');
    });
    $(".controls_tr").mouseenter(function () {
        $(this).find(".controls").show();
    }).mouseleave(function () {
        $(this).find(".controls").hide();
    });

    var url = "{:U('business/getcurrentstatus')}";
    var limit_size = 1000;
    var count = '{$count}';
    var i = 1;
    function remainTime() {
        var id_array = new Array();
        $("input[class='check_list']:checked").each(function () {
            id_array.push($(this).val());
        });
        $.get(url, function (data) {
            if (data.data == 0) {
                if ((i - 1) * limit_size < count) {
                    $("#act").val('excel');
                    $("#current_page").val(i);
                    $("#export_limit").val(limit_size);
                    $("#daochu").val(id_array);
                    $("#searchForm").submit();
                    setTimeout("remainTime()", 1000);
                    i++;
                } else {
                    i = 1;
                }
            } else {
                setTimeout("remainTime()", 1000);
            }
        }, 'json');
    }

    $("#dialog-field-search").dialog({
        autoOpen: false,
        modal: true,
        width: 700,
        minHeight: 350,
        maxHeight: 450,
        position: ["center", 100],
        buttons: {
            "确定": function () {
                doh();
                if (dosearch == 1) {
                    $(this).dialog("close");
                }
            },
            "取消": function () {
                $(this).dialog("close");
            }
        }
    });
    $("#search_type").click(function () {
        $("#dialog-field-search").dialog('open');
    });

// 筛选重复判断
    var dosearch = 1;
    function doh() {
        var ary = new Array();
        var field_name = '';
        var is_submit = 1;
        $('.field_name').each(function (k, v) {
            field_name = $(this).find("option:selected").val();
            if (jQuery.inArray(field_name, ary) >= 0) {
                is_submit = 0;
                swal({
                    title: "筛选条件中有重复项！",
                    text: "",
                    type: "error"
                });
                dosearch = 0;
                return false;
            }
            ary[k] = field_name;
        })
        if (is_submit == 1) {
            $("#searchForm").submit();
        }
    }

    $("#dialog-product_view").dialog({
        autoOpen: false,
        modal: true,
        minWidth: 800,
        maxHeight: 600,
        position: ["center", 100]
    });
//产品详情
    $(".product_view").click(function () {
        var business_id = $(this).attr('rel');
        var customer_id = $(this).attr('rel1');
        var code = $(this).attr('rel2');
        //判断是否有职位编号，如果没有则提示添加产品
        if (!code) {
            swal({
                title: "请先添加产品信息",
                text: "",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "添加产品",
                closeOnConfirm: true,
            }, function () {
                $('#dialog-addproduct').dialog('open');
                $('#dialog-addproduct').load('{:U("product/mutildialog_product","customer_id=")}' + customer_id);
            });
        } else {
            $('#dialog-product_view').dialog('open');
            $('#dialog-product_view').load('{:U("business/product_view","id=")}' + business_id);
        }
    });
    /*营销阶段*/
    $("#dialog-advance").dialog({
        autoOpen: false,
        modal: true,
        minWidth: 320,
        maxHeight: 800,
        position: ["center", 100]
    });
//推进
    $(".advance").click(function () {
        var business_id = $(this).attr('rel');
        var customer_id = $(this).attr('rel1');
        var code = $(this).attr('rel2');
        $('#dialog-advance').dialog('open');
        $('#dialog-advance').load('{:U("business/advance","id=")}' + business_id);
    });

    $("#remind").click(function () {
        var business_id = $(this).attr('rel1');
        $('#dialog-remind').dialog('open');
        $('#dialog-remind').load("{:U('remind/add','module=business&module_id=')}" + business_id);
    });

    $(".remind_view").click(function () {
        var business_id = $(this).attr('rel');
        $('#dialog-remind_view').dialog('open');
        $('#dialog-remind_view').load("{:U('remind/view','module=business&module_id=')}" + business_id);
    });

    $("#to_top").click(function () {
        var business_id = $(this).attr('rel');
        $("#form1").attr('action', '{:U("customer/settop","module=business&module_id=")}' + business_id);
        $("#form1").submit();
    });
    $("#to_allot").click(function () {
        let business_id = $(this).attr('rel');
        $('#dialog-role-owner').dialog('open');
        //$('#dialog-role-owner').load('{:U("Business/BusinessOwner","businessid=")}'+business_id);
        $('#dialog-role-owner').load('/index.php?m=business&a=businessowner&businessid=' + business_id + '&ac=0');
    });
    $("#to_share").click(function () {
        let business_id = $(this).attr('rel');
        $('#dialog-role-owner').dialog('open');
        //$('#dialog-role-owner').load('{:U("Business/BusinessOwner","businessid=")}'+business_id);
        $('#dialog-role-owner').load('/index.php?m=business&a=businessowner&businessid=' + business_id + '&ac=1');
    });

    $("#log_business").click(function () {
        $('#dialog-log').dialog('open');
        $('#dialog-log').load('{:U("log/add","r=RBusinessLog&module=business&id=")}' + $(this).attr('rel'));
    });

    $('#delete').click(function () {
        var id_array = new Array();
        $("input.check_list:checked").each(function () {
            id_array.push($(this).val());
        });
        if (id_array.length == 0) {
            alert_crm('您没有选择任何数据！');
            return false;
        }
        swal({
            title: "您确定要删除选中的项目吗？",
            text: "删除后将无法恢复，请谨慎操作！",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "是的，我要删除！",
            cancelButtonText: '让我再考虑一下…',
            closeOnConfirm: false,
            closeOnCancel: false
        },
                function (isConfirm) {
                    if (isConfirm) {
                        $.ajax({
                            type: 'post',
                            url: "{:U('business/delete')}",
                            data: {business_id: id_array},
                            async: false,
                            success: function (data) {
                                if (data.status == 1) {
                                    swal("删除成功！", "您已经永久删除了信息！", "success");
                                    location.reload();
                                } else {
                                    swal({
                                        title: "操作失败！",
                                        text: data.info,
                                        type: "error"
                                    });
                                    return false;
                                }
                            },
                            dataType: 'json'
                        });
                    } else {
                        swal("已取消", "您取消了删除操作！", "error");
                    }
                });
    });

    <if condition="C('ismobile') eq 1">width=$('.container').width() * 0.9;<else/>width=800;</if>

    $("#dialog-role-info").dialog({
        autoOpen: false,
        modal: true,
        width: width,
        maxHeight: 550,
        position: ["center", 100]
    });
    $("#dialog-role-owner").dialog({
        autoOpen: false,
        modal: true,
        width: width,
        maxHeight: 550,
        position: ["center", 100]
    });

    $(function () {
        $("#edit_business").click(function () {
            window.location.href = "{:U('business/edit', '&p='.$this_page.'&id=')}" + $(this).attr('rel');
        })
        $("#excelExport").click(function () {
            if (count > limit_size) {
                if (confirm('当前导出量过大，将分几次导出，可能需要您等待一段时间，是否继续?')) {
                    remainTime();
                }
            } else {
                var id_array = new Array();
                $("input[class='check_list']:checked").each(function () {
                    id_array.push($(this).val());
                });
                if (id_array != '') {
                    if (confirm("{:L('ARE_YOU_SURE_YOU_WANT_TO_EXPORT_THE_BUSINESS_OPPORTUNITIES')}")) {
                        remainTime();
                    }
                } else {
                    if (confirm("确定要导出全部吗？")) {
                        remainTime();
                    }
                }
            }
        });

        $(".role_info").click(function () {
            $role_id = $(this).attr('rel');
            $('#dialog-role-info').dialog('open');
            $('#dialog-role-info').load('{:U("user/dialoginfo","id=")}' + $role_id);
        });

        $("#dialog-log").dialog({
            autoOpen: false,
            modal: true,
            width: width,
            maxHeight: 400,
            position: ["center", 100],
            buttons: {
                "确定": function () {
                    // $('#dialog_form1').submit();
                    // $(this).dialog("close");

                    var log_content = $('#log_content').val();
                    var nextstep_time = $('#nextstep_time').val();
                    if (log_content == "") {
                        alert_crm("请填写内容！");
                        $("#log_content").focus();
                        return false;
                    }
                    $.ajax({
                        type: 'post',
                        url: "{:U('Log/add')}",
                        data: $('#dialog_form1').serialize(),
                        async: false,
                        success: function (data) {
                            if (data.status == 1) {
                                swal("操作成功！", "沟通日志添加成功！", "success");
                                $("#dialog-log").dialog("close");
                                $('#nextstep_time_' + dialog_module_value).html(nextstep_time);
                                $('#nextstep_' + dialog_module_value).html(log_content);
                                // location.reload();
                            } else {
                                swal({
                                    title: "操作失败！",
                                    text: data.info,
                                    type: "error"
                                })
                                return false;
                            }
                        },
                        dataType: 'json'
                    });
                },
                "取消": function () {
                    $(this).dialog("close");
                }
            }
        });

        $("#dialog-remind").dialog({
            autoOpen: false,
            modal: true,
            width: width,
            maxHeight: 400,
            position: ["center", 100],
            buttons: {
                "确定": function () {
                    if ($('#dialog_content').val() == '') {
                        alert_crm("请填写提醒内容！")
                        $("#dialog_content").focus();
                    } else {
                        $('#remind_form').submit();
                        $(this).dialog("close");
                    }
                },
                "取消": function () {
                    $(this).dialog("close");
                }
            }
        });
        $("#dialog-remind_view").dialog({
            autoOpen: false,
            modal: true,
            width: width,
            maxHeight: 400,
            position: ["center", 100],
            buttons: {
                "删除": function () {
                    var business_id = $('#dislog_module_id').val();
                    swal({
                        title: "您确认删除吗？",
                        type: "warning",
                        showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        confirmButtonText: "确定",
                        closeOnConfirm: false
                    },
                            function () {
                                var dislog_module_id = $('#dislog_module_id').val();
                                var dislog_module = $('#dislog_module').val();
                                $.ajax({
                                    type: 'post',
                                    url: "{:U('remind/delete')}",
                                    data: {module_id: dislog_module_id, module: dislog_module},
                                    async: false,
                                    success: function (data) {
                                        if (data.status == 1) {
                                            $('#remind_view_' + dislog_module_id).addClass('hide');
                                            swal("操作成功！", "提醒删除成功！", "success");
                                            $("#dialog-remind_view").dialog("close");
                                        } else {
                                            swal({
                                                title: "操作失败！",
                                                text: data.info,
                                                type: "error"
                                            })
                                            return false;
                                        }
                                    },
                                    dataType: 'json'
                                });
                                // $("#dialog_remind").submit();
                                // $(this).dialog("close");
                            });
                },
                "取消": function () {
                    $(this).dialog("close");
                }
            }
        });
    })

//编辑项目状态效果
    $(function () {
        //点击效果
        $(".jinzhan_status").click(function () {
            $(".status_ico").hide();
            $(this).next().show();
        })
        //点击确认按钮修改状态
        $(".jinzhan_btnedit").click(function () {
            var business_id = parseInt($(this).closest("tr").find(".check_list").attr("rel"));
            var status_type = $(this).closest(".editable-controls").find("select option:selected").val();
            $.ajax({
                type: "post",
                url: "/index.php?m=business&a=edit",
                data: {
                    business_id: business_id,
                    status_id: status_type
                },
                success: function (data) {
                    console.log(data);
                    swal("温馨提示！", "状态修改成功！", "success");
                    window.location = location;
                },
                error: function () {

                }
            })
        })

        $(".closeico").click(function () {
            $(".status_ico").hide();
        })
    })


    $(function () {
        $("body").on("click", "#close_iframe", function () {
            $('#if1000').hide();
        })

    })

</script>

<include file="Public:footer" />


<div id="right-sidebar-log">
    <!--the css for jquery.mCustomScrollbar-->
    <link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.mCustomScrollbar.min.css"/>
    <!--the css for this plugin-->
    <link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.emoji.css"/>
    <!--(Optional) the js for jquery.mCustomScrollbar's addon-->
    <script src="__PUBLIC__/emoji/js/jquery.mousewheel-3.0.6.min.js"></script>
    <!--the js for jquery.mCustomScrollbar-->
    <script src="__PUBLIC__/emoji/js/jquery.mCustomScrollbar.min.js"></script>
    <!--the js for this plugin-->
    <script src="__PUBLIC__/emoji/js/jquery.emoji.js"></script>

    <div class="sidebar-container" id="sidebar-container">

    </div>
</div>
<style>

    #right-sidebar-log{
        width: 60% !important;
        right: -60%;
        background-color: #fff;
        overflow: hidden;
        position: fixed;
        top: 60px;
        z-index: 1009;
        bottom: 0;
        box-shadow: -5px -5px 1px #ccc;
    }

</style>
<script src="__PUBLIC__/resume_selector/common.21a64352.js"></script>
<script src="__PUBLIC__/resume_selector/resume.search.910ebde0.js "></script>